﻿using System.Net;
using System.Text;
using Comunication;

namespace Client
{
    public class UdpUtilClient : IUdpUtils
    {
        #region Implementation of IUdpUtils

        public void ProcessPacket(byte[] buffer, IPEndPoint remoteEndpoint)
        {
            UTF8Encoding decoder = new UTF8Encoding();
            string header = decoder.GetString(buffer, 0, 3);
            string cmd = decoder.GetString(buffer, 3, 2);
            int dataLength = int.Parse(decoder.GetString(buffer, 5, 5));
            string data = decoder.GetString(buffer, 10, dataLength);

            Commands command = (Commands)int.Parse(cmd);

            switch (command)
            {
                case Commands.SERVER_CLIENT_FIND_SERVER_RESPONSE:

                    break;
            }
        }

        #endregion
    }
}
